package com.zlp.spring.mybatis.spring;

import org.apache.ibatis.annotations.Select;
import org.springframework.beans.factory.FactoryBean;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;

/**
 * MyInvocationHandler
 * 自定义代理对象
 * @date: 2022/2/22 17:12
 */
public class MyInvocationHandler implements InvocationHandler {



    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        String value = method.getAnnotation(Select.class).value()[0];
        System.out.println(" query db execute sql ="+value);
        return null;
    }




}
